const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const HtmlPlugin = require('html-webpack-plugin');
module.exports = {
    entry:'./src/main.js',
    output:{
        filename:'build.js',
        path:path.resolve(__dirname,'./dist')
    },
    module:{
        rules:[
            {
                test:/\.vue$/,
                loader:'vue-loader'
            },
            {
                test:/\.js$/,
                loader:'babel-loader'
            },
            {
                test: /\.css$/,
                use: [
                    'vue-style-loader',
                    'css-loader'
                ]
            },
            {
                test:/\.(eot|svg|ttf|woff|woff2)$/,
                use:{
                    loader:'url-loader',
                    options:{
                        limit:1234,
                        name:'font/[name].[ext]',
                        publicPath:'/'
                    }
                }
            }
        ]
    },
    plugins:[
        new VueLoaderPlugin(),
        new HtmlPlugin({
            filename:'index.html',
            template:'./index.html'
        })
    ],
    devServer:{
        port:9090
    },
    resolve:{
        alias:{
            'vue$':path.resolve(__dirname,'node_modules/vue/dist/vue.esm.js')
        },
        // extensions: [".vue", ".css"]
    }
}